<div class="main-content">
	<div class="breadcrumbs" id="breadcrumbs">
		<script type="text/javascript">
			try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
		</script>

		<!-- .breadcrumb -->
	</div>

	<div class="page-content">
		<div class="row">
			<div class="page-header">
				<h1>订单列表</h1>
			</div>
            
	        <div class="col-md-12 col-sm-12 col-xs-12 form">

        	<div class="col-xs-12 margin_t margin_b">
				<div class="table-responsive  tab">
				<form action="<?php echo base_url()."admin/order/del_some"?>" method="post" id="delForm" style="overflow-x: scroll;">
					<table id="sample-table-1" class="table table-striped table-bordered table-hover" style="width:100%;">
						<thead>
							<tr>
								<th class="center" style="width: 3%;">
									<label>
										<input type="checkbox" class="ace" />
										<span class="lbl"></span>
									</label>
								</th>
								<th>订单编号</th>
                               	<th>油站</th>
                                <th>订单金额</th>
                                <th>折后金额</th>
                                <th>服务费</th>
                                <th>转账金额</th>
                                
                                <th>申请时间</th>
                                <th>操作</th>
							</tr>
						</thead>

						<tbody>
							<?php if (isset($result)&&count($result)>0){
                            	foreach ($result as $app){
                            	?>
							<tr>
								<td class="center">
                                	<p>
									<label>
										<input type="checkbox" class="ace" name="num[]" value="<?php echo $app->id;?>"/>
										<span class="lbl"></span>
									</label>
                                    </p>
								</td>
								<td><p><?php echo $app->order_no;?></p></td>
                                <td><?php echo $app->gasstation_name;?></td>
                                <td><p><?php echo $app->order_price;?></p></td>
                                <td><p><?php echo $app->zhe_price?></p></td>
                                <td><p><?php echo $app->fuwu_price?></p></td>
                            	<td><p><?php echo $app->should_pay?></p></td>
                            	<td><p><?php echo $app->create_time?></p></td>
                                <td><p>
	                                    <a href="javascript:void(0)" onclick="tixian('<?php echo $app->id;?>')" data-toggle="modal" class="btn btn-danger btn-sm"><i class="icon-trash"></i>确认打款</a>
                                    </p>
                                </td>
    						</tr>
    						<?php }
                            }else{?>
                            <tr>
                            	<td colspan="15">无数据</td>
                            </tr>
                            <?php }?>
						</tbody>
					</table>
					</form>
				</div><!-- /.table-responsive -->
			</div>
        
		</div><!-- /.row -->
	</div><!-- /.page-content -->
</div><!-- /.main-content -->

<script type="text/javascript">

function tixian(id){
	if(confirm('确认已经打款？')){
		$.post("<?php echo base_url().'/admin/order/do_settle'?>",{id:id},function(res){
			if(res == false){
				alert('更新状态失败');
				return;
			}else{
				window.location.reload();
			}

		})
	}
}


layui.use(['form','element','laydate'], function(){
  var form = layui.form,
  	element = layui.element,
  	laydate = layui.laydate;

  //时间选择器
  laydate.render({
    elem: '#start_time'
    ,type: 'datetime'
  });
    //时间选择器
  laydate.render({
    elem: '#end_time'
    ,type: 'datetime'
  }); 


});


</script>
